package com.demo.other;

import org.apache.log4j.Logger;

/**
 * 演示日志打印规范
 * @author gy
 * @date 2022/4/10
 */
public class LogPrintStandard {

    private static final Logger logger = Logger.getLogger(LogPrintStandard.class);

    public static void main(String[] args) {
        try {
            int i = 1 / 0;
        } catch (Exception e) {

            System.out.println("======规范=====");
            logger.error("此处的异常为:",e);

            System.out.println("======打印message======");
            logger.error("异常为"+e.getMessage());


            System.out.println("======控制台打印异常栈======");
            e.printStackTrace();
        }


    }
}
